﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:Custom="http://schemas.microsoft.com/surface/2008"
                    xmlns:UserControls="clr-namespace:ScrumTable.UI.View.WinTouch.UserControls">
    
        <!-- Base Grid style for 55 dpi -->
        <Style TargetType="{x:Type Control}" x:Key="ControlBaseStyle">
            <Setter Property="FocusVisualStyle"	
				Value="{x:Null}"/>
            <Setter Property="SnapsToDevicePixels"
				Value="False"/>
            <Setter Property="FontFamily"
				Value="Segoe UI"/>
            <Setter Property="FontWeight"
				Value="Normal"/>
            <Setter Property="FontSize"
				Value="17"/>
            <Setter Property="Padding"
				Value="6,2,10,10"/>
            <Setter Property="MinHeight"
				Value="38"/>
            <Setter Property="MinWidth"
				Value="38"/>
            <Setter Property="Margin"
				Value="1"/>
            <Setter Property="HorizontalContentAlignment"
				Value="Left"/>
            <Setter Property="VerticalContentAlignment"
				Value="Top"/>
            <Setter Property="BorderThickness"
				Value="2"/>
        </Style>

        <!-- ButtonBase -->
        <Style x:Key="StyleFeedbackButton"
			TargetType="{x:Type Custom:SurfaceButton}" 
			BasedOn="{StaticResource ControlBaseStyle}">
            <Setter Property="IsTabStop"
				Value="False" />
            <Setter Property="Focusable"
				Value="True" />
            <Setter Property="Background"
				Value="{DynamicResource {x:Static Custom:SurfaceColors.ButtonBackgroundBrushKey}}" />
            <Setter Property="Foreground"
				Value="{DynamicResource {x:Static Custom:SurfaceColors.ButtonForegroundBrushKey}}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Custom:SurfaceButton}">
                        <ControlTemplate.Resources>
                            <Storyboard x:Key="Press">
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
									Storyboard.TargetName="PressOverlay"
									Storyboard.TargetProperty="(UIElement.Opacity)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.1000000"
										Value="1" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                            <Storyboard x:Key="Release">
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
									Storyboard.TargetName="PressOverlay"
									Storyboard.TargetProperty="(UIElement.Opacity)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.1500000"
										Value="0" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </ControlTemplate.Resources>
                        <Grid x:Name="Grid"
							SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RenderTransformOrigin="0.5,0.5">
                            <Grid.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform/>
                                    <SkewTransform/>
                                    <RotateTransform/>
                                    <TranslateTransform/>
                                </TransformGroup>
                            </Grid.RenderTransform>
                            <Rectangle  x:Name="ButtonBody"
								Fill ="{TemplateBinding Background}"
								SnapsToDevicePixels ="{TemplateBinding SnapsToDevicePixels}"/>
                            <Rectangle  x:Name="PressOverlay"
								Opacity="0"
								Fill ="{DynamicResource {x:Static Custom:SurfaceColors.ButtonBackgroundPressedBrushKey}}" 							             
								SnapsToDevicePixels ="{TemplateBinding SnapsToDevicePixels}"/>
                            <ContentPresenter  x:Name="Content"
								Margin="{TemplateBinding Padding}"  
								HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"		                                                                           
								VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
								SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Grid>

                    <ControlTemplate.Triggers>

                        <Trigger Property="AreAnyTouchesOver" Value="True">
                            <Setter Property="Opacity" Value="0.7"/>
                            <Setter Property="RenderTransform" TargetName="Grid">
                                <Setter.Value>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="0.9" ScaleY="0.9"/>
                                        <SkewTransform/>
                                        <RotateTransform/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Opacity" Value="0.7"/>
                            <Setter Property="RenderTransform" TargetName="Grid">
                                <Setter.Value>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="0.9" ScaleY="0.9"/>
                                        <SkewTransform/>
                                        <RotateTransform/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                            <Trigger Property="IsEnabled"
								Value="False">

                                <Setter Property="Opacity"
									Value="0.33"
									TargetName="ButtonBody" />                                
                                
                                <Setter Property="Opacity"
									Value="0.33"
									TargetName="Content" />
                                
                            </Trigger>                          
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>


    
    <Style TargetType="{x:Type Custom:SurfaceButton}" BasedOn="{StaticResource StyleFeedbackButton}"/>
    <Style TargetType="{x:Type UserControls:AddButton}" BasedOn="{StaticResource StyleFeedbackButton}"/>
    <!---->
</ResourceDictionary>